package arsmodeller.figure;

import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.EllipseAnchor;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.XYLayout;

public class ProcessFigure extends Figure implements ThingFigure {
	private Label nameLabel;
	private Ellipse ellipse;
	private ConnectionAnchor connectionAnchor;

	public ProcessFigure() {
		setLayoutManager(new XYLayout());
		ellipse = new Ellipse();
		add(ellipse);
		nameLabel = new Label();
		add(nameLabel);
	}

	public Label getNameLabel() {
		return nameLabel;
	}

	@Override
	public ConnectionAnchor getConnectionAnchor() {
		if (connectionAnchor == null) {
			connectionAnchor = new EllipseAnchor(this);
		}
		return connectionAnchor;
	}

}
